import { createWebHistory, createRouter } from 'vue-router'
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'

const routes = [
    {
        path: '/',
        name: 'home',
        component: () => import('@/views/home.vue'),
    },
    {
        path: '/about',
        name: 'about',
        component: () => import('@/views/about.vue'),
    },
]

const router = createRouter({
    history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? `/subHomePage` : '/'),   //这里需要配置/subHomePage,不然会点击跳转home到主应用的home
    routes,
})

export default router
